The present invention generally relates to methods and apparatus for displaying images in a computer controlled raster display system. More particularly, this invention relates to procedures for determining the pixels affected by lineal or point features in such images and for rendering those features for display.
Many modern computer systems are able to display complex three-dimensional objects on display devices that are controlled by the computer systems, and commonly these complex objects are displayed interactively to allow the computer user to manipulate the objects. Well known graphics techniques for rendering these three dimensional objects such as Gouraud shading, hidden surface algorithms, clipping, filling polygons and coordinate transformations are used to generate the displayed object on a suitable device, such as a CRT video display that is controlled by the computer system.
Often in the operation of these computer systems, a polygon representation of the object is converted to a raster scanned image that is stored in a frame buffer. Typically, various parameter values, such as color, depth and translucency, are given for the vertices of the polygon, and in a process referred to as scan conversion, the computer uses the given values to compute values for these parameters for the pixels inside the polygon. The computed values are stored in the frame buffer at the resolution of the display device; and from the frame buffer, these values may be used to produce an image of the object on the display device.
With these prior art computer graphics systems, difficulties may be encountered when displaying images of, or drawing, lines and points; and in particular, lines and points often have a jagged appearance. Among other disadvantages, this jagged look reduces the realism of a displayed image. The display of jagged lines and points is largely the result of the fact that only a portion of an actual pixel is covered by a line or point and is also due to the fact that the pixels on the display device have a finite size rather than being infinitely small points.
The appearance of jagged lines and points can sometimes be improved by modifying the original color values computed for the pixels used to show the lines and points, and commonly the color values for these pixels are modified to blend better with the color values for adjacent pixels. The display of unwanted jagged lines or edges is one type of a class of undesirable visual effects generally called aliasing, and procedures for eliminating or improving the appearance of jagged lines and points are one type of a group of procedures referred to as anti-aliasing. Prior art anti-aliasing techniques for eliminating or ameliorating the visual effects of jagged lines and points are typically cumbersome or not fully effective.
An object of this invention is to provide a simple, inexpensive and effective method and apparatus for determining the pixels affected by lineal or point features in a computer controlled image display system.
Another object of the present invention is to use planar edge equations to determine the pixels affected by lineal or point features in a computer controlled image display system.
A further object of the present invention is to provide a simple, inexpensive and effective method and apparatus for computing approximate area-weighting of pixels affected by lineal or point features for use with antialiasing.
Another object of this invention is to utilize planar edge equations to compute approximate area weighting of pixels affected by lineal or point features for use with antialiasing.
A further object of this invention is to identify an antialiasing region in a polygon used to show a line or point on a pixel array, and to determine color blend values for pixels in that antialiasing region as a function of planar edge coefficients calculated for those pixels.
These and other objectives are attained with a method and system for rendering a feature, such as a line, for display on an array of pixels. With this method, the line is identified on the pixel array, the line is expanded into a polygon, and color values are determined for the pixels within the polygon. Also, an antialiasing region is identified in the polygon, and blend values are computed for the pixels in this antialiasing region. Then, the color values determined for the pixels in the antialiasing region are modified as a function of these computed blend values. The pixels in the antialiasing region may then be shown at their modified color values, while the pixels that are in the polygon but not in the antialising region may be shown at their original determined color value.
Preferably, the blend values for the pixels in the antialiasing region are calculated as a function of the locations of the pixels in that region. For example, the blend value for each of these pixels may be calculated as a function of four values, each one representing the Manhattan distance from the pixel to a respective one of the edges of the polygon. Also, preferably the antialiasing region has a uniform width, and this region extends inward from side edges and outward from end edges of the formed polygon.
Further benefits and advantages of the invention will become apparent from a consideration of the following detailed description, given with reference to the accompanying drawings, which specify and show preferred embodiments of the invention.